<?php

/**
 * Add CSS
 *
 * @package Rapide_View
 */
class Rapide_View_Helper_Css extends Rapide_View_Helper
{
	/**
	 * Add CSS
	 *
	 * @param string $sCss
	 * @param string $sMedium
	 * @param string $sCondition
	 */
	public function execute($sCss, $sMedium = null, $sCondition = null)
	{
		$oView = $this->getView();

		if(!$oView instanceof Rapide_View_Html)
			return;

		$sSrc = Rapide_Controller_Front::getInstance()
						->getRouter()
						->url();

		$sCss = $sSrc . 'Template/css/' . $sCss;

		$sCssAttribute = Rapide_View_Html::CSS_ATTRIBUTE;

		if(empty($sMedium))
			$sMedium = 'all';

		$aCss	 = $oView->$sCssAttribute;
		$aCss[] = array('href' => $sCss, 'media' => $sMedium, 'condition' => $sCondition);

		$oView->$sCssAttribute = $aCss;
	}
}

?>